package com.eastfair.venuebooking.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.venuebooking.dto.*;
import com.eastfair.venuebooking.entity.SaleClue;
import com.eastfair.venuebooking.vo.SaleClueVO;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 销售线索表
 * </p>
 *
 * @author linan
 * @date 2022-06-08
 */
public interface SaleClueService extends SuperService<SaleClue> {

    /**
     * 分页查询销售线索.
     *
     * @param pageParams the page params
     * @return the page
     */
    IPage<SaleClueVO> listSaleClueVOs(PageParams<SaleClueQuery> pageParams);

    /**
     * id查询.
     *
     * @param id the id
     * @return the sale clue vo
     */
    SaleClueVO getSaleClueVOById(Long id);

    /**
     * 商机ID查询关联的线索.
     *
     * @param businessOpportunityId the business opportunity id
     * @return the by business opportunity id
     */
    SaleClue getByBusinessOpportunityId(Long businessOpportunityId);

    /**
     *  销售线索是否存在.
     *
     * @param query the customer id
     * @return the boolean true：存在/false：不存在
     */
    boolean existSaleClue(SaleClueQuery query);

    /**
     * 客户ID查询线索是否存在.
     *
     * @param customerIds the customer ids
     * @return the boolean true：存在/false：不存在
     */
    boolean existSaleClueByCustomerId(List<Long> customerIds);

    /**
     * 联系人ID查询线索是否存在.
     *
     * @param contactIds the contact ids
     * @return the boolean true：存在/false：不存在
     */
    boolean existSaleClueByContactId(List<Long> contactIds);

    /**
     * 保存销售线索.
     *
     * @param saleClueDTO the sale clue dto
     * @return the boolean
     */
    boolean saveSaleClue(SaleClueDTO saleClueDTO);

    /**
     * 更新销售线索.
     *
     * @param saleClueDTO the sale clue dto
     * @return the boolean
     */
    boolean updateSaleClue(SaleClueDTO saleClueDTO);

    /**
     * 更新销售线索，不保存展会客户关系.
     *
     * @param saleClueDTO the sale clue dto
     * @return the sale clue
     */
    SaleClue updateSaleClueWithoutExhibitionCustomer(SaleClueDTO saleClueDTO);

    /**
     * 线索保存展会客户关系并更新商机.
     *
     * @param saleClue the sale clue dto
     * @return the boolean
     */
    boolean saveExhibitionCustomerAndUpdateBusinessOpportunity(SaleClue saleClue);

    /**
     * 保存展会客户关系.
     *
     * @param saleClue the sale clue
     * @return the exhibition customer dto
     */
    ExhibitionCustomerDTO saveExhibitionCustomer(SaleClue saleClue);

    /**
     * 更新线索得跟进信息.
     *
     * @param updateDTO the update dto
     * @return the boolean
     */
    boolean updateFollow(SaleClueDTO updateDTO);

    /**
     * 更新线索得跟进信息.
     *
     * @param followRecordPlanSaveDTO the follow record plan save dto
     * @return the boolean
     */
    boolean updateFollow(FollowRecordPlanSaveDTO followRecordPlanSaveDTO);

    /**
     * 移入公共.
     *
     * @param publicDTO the public dto
     * @return the boolean
     */
    boolean updatePublic(SaleCluePublicDTO publicDTO);

    /**
     * 更新归属人.
     *
     * @param assignDTO the assign dto
     * @return the boolean
     */
    boolean updateBelongTo(SaleClueAssignDTO assignDTO);

    /**
     * 批量更新归属人
     *
     * @param assignDTO assignDTO
     * @return boolean
     */
    boolean updateBelongTo(List<SaleClueAssignDTO> assignDTO);

    /**
     * 更新 state.
     *
     * @param saleClueDTO the sale clue dto
     * @return the boolean
     */
    boolean updateState(SaleClueDTO saleClueDTO);

    /**
     * 更新状态.
     *
     * @param updateDTO the update dto
     * @return the boolean
     */
    boolean updateClueStatus(SaleClueDTO updateDTO);

    /**
     * 商机更新线索的举办类型.
     *
     * @param exhibitionCustomerDTO the sale clue dto
     * @return the boolean
     */
    boolean updateCustomerIdentityByBusinessOpportunity(ExhibitionCustomerDTO exhibitionCustomerDTO);

    /**
     * 移除线索.
     *
     * @param ids the ids
     * @return the boolean
     */
    boolean removeByIds(List<Long> ids);
}
